from fastapi import APIRouter, Depends
from sqlalchemy.orm import Session
from config.database import get_db
from models import User
from schemas import ResponseModel, UserResponse
from auth import get_current_user

router = APIRouter()

@router.get("/profile", response_model=ResponseModel)
async def get_profile(
    current_user: User = Depends(get_current_user),
    db: Session = Depends(get_db)
):
    """获取个人信息"""
    user_response = UserResponse.from_orm(current_user)
    
    return ResponseModel(
        code=200,
        message="获取个人信息成功",
        data=user_response
    )